package mt.omid.dimomuth.mgm;


//import mt.omid.dimomuth.mgm.xmlrpc.VSPOTHandlerMapping;

//import java.io.IOException;
//import java.util.logging.Level;
import java.util.logging.Logger;

import mt.omid.dimomuth.mgm.xmlrpc.XmlRPCServer;


public class XmlRpcIf extends ManagementIf
{

//    private MgmHandler   hndl;
    private Thread       myThrd;

    private XmlRPCServer myRpcServer;


    public XmlRpcIf( int port, Logger lgr )
    {
	super( port, lgr );
	this.port = port;
	this.logger = lgr;
    }

    @Override
    public void start( MgmHandler hndl )
    {
	this.myRpcServer = new XmlRPCServer( this.port, this.logger, hndl );
	myThrd = new Thread( this, "MgmRPCServer-" + this.getClass().getSimpleName() );
	myThrd.start();
    }

    @Override
    public void run()
    {
	logger.fine( "Start XmlRpcServer Thread." );
	this.myRpcServer.startServer();
    }

    @Override
    public void shutdown()
    {
	logger.fine( "Shutting Down XmlRpcServer." );
	this.myRpcServer.shutdown();
    }
}
